# iRODS local rules for ARCS sites
# Default-resource must be set appropriately for your site (e.g. arcs-df.vpac.org)
#
#####acSetRescSchemeForCreate|$userNameClient == guest %% $userNameClient == anonymous|msiSetNoDirectRescInp(ARCS-FABRIC%arcs-df.ivec.org%arcs-df.vpac.org%arcs-df.qcif.edu.au%arcs-df.intersect.org.au%arcs-df.tpac.org.au%emii.resource.tpac.org.au%arcs-df.eresearchsa.edu.au)|nop

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/home/*/Archive_S3/*"|msiSetDefaultResc(s3Resc_us,preferred)|nop
acSetRescSchemeForCreate {
	on($objPath like "/ARCS/home/*/Archive_S3/*") {
		msiSetDefaultResc("s3Resc_us","preferred");
		}
	}

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/projects/TCMIP/*"|msiSetDefaultResc(arcs-df.vpac.org,preferred)|nop
acSetRescSchemeForCreate {
        on($objPath like "/ARCS/projects/TCMIP/*") {
                msiSetDefaultResc("arcs-df.vpac.org","preferred");
                }
        }

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/home/charlie.bond/*"|msiSetDefaultResc(arcs-df.ivec.org,preferred)|nop
acSetRescSchemeForCreate {
        on($objPath like "/ARCS/home/charlie.bond/*") {
                msiSetDefaultResc("arcs-df.ivec.org","preferred");
                }
        }

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/home/stephen.anthony/*"|msiSetDefaultResc(arcs-df.ivec.org,preferred)|nop
acSetRescSchemeForCreate {
        on($objPath like "/ARCS/home/stephen.anthony/*") {
                msiSetDefaultResc("arcs-df.ivec.org","preferred");
                }
        }

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/home/kylie.pitt/*"|msiSetDefaultResc(arcs-df.qcif.edu.au,preferred)|nop
acSetRescSchemeForCreate {
        on($objPath like "/ARCS/home/kylie.pitt/*") {
                msiSetDefaultResc("arcs-df.qcif.edu.au","preferred");                }
        }

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/projects/PUBLUMW/*"|msiSetDefaultResc(arcs-df.vpac.org,preferred)|nop
acSetRescSchemeForCreate {
        on($objPath like "/ARCS/projects/PUBLUMW/*") {
                msiSetDefaultResc("arcs-df.vpac.org","preferred");
                }
        }

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/projects/LiDAR/*"|msiSetDefaultResc(arcs-df.qcif.edu.au,preferred)|nop
acSetRescSchemeForCreate {
        on($objPath like "/ARCS/projects/LiDAR/*") {
                msiSetDefaultResc("arcs-df.qcif.edu.au","preferred");                }
        }

#acSetRescSchemeForCreate||msiSetDefaultResc(ARCS-FABRIC,preferred)|nop
acSetRescSchemeForCreate {
		msiSetDefaultResc("ARCS-FABRIC","preferred");
	}


#acSetVaultPathPolicy||msiSetGraftPathScheme(no,0)|nop
acSetVaultPathPolicy {
		msiSetGraftPathScheme("no","0");
	}

#Replication Rules
#acPostProcForPut|$dataSize > 0|delayExec(<PLUSET>30s</PLUSET>,msiExecCmd(replicate.py,$dataId,null,null,null,*REPLI_OUT),nop)|nop
#acPostProcForCopy|$dataSize > 0|delayExec(<PLUSET>30s</PLUSET>,msiExecCmd(replicate.py,$dataId,null,null,null,*REPLI_OUT),nop)|nop
acPostProcForPut {
                on($dataSize > 0) {
                        delay("<EF>30s</EF>") {
                                msiExecCmd("replicate.py",$dataId,"null","null","null",*Result);
                }
        }
}

acPostProcForCopy {
                on($dataSize > 0) {
                        delay("<EF>30s</EF>") {
                                msiExecCmd("replicate.py",$dataId,"null","null","null",*Result);
                }
        }
}

#Access control, trash and quotas
#acAclPolicy|"$userNameClient" != "QuickShare"|msiAclPolicy(STRICT)|nop
acAclPolicy {
        on("$userNameClient" != "QuickShare") {
                msiAclPolicy("STRICT");
                }
        }

#acTrashPolicy||nop|nop
#acRescQuotaPolicy||msiSetRescQuotaPolicy(off)|nop
#acSetReServerNumProc||msiSetReServerNumProc(8)|nop
acTrashPolicy { }
acRescQuotaPolicy {msiSetRescQuotaPolicy("off");}
acSetReServerNumProc {msiSetReServerNumProc("8");}




# Rules to stop deletion and moving. Note that for this to work the corresponding rules most be commented in core.irb
#acPreprocForRmColl|($collParentName != /ARCS/home) && ($collParentName != /ARCS/projects) && ("$collName" != "/ARCS/home/$userNameClient/Archive_S3")|nop|nop
acPreprocForRmColl {
                on($collParentName != "/ARCS/home") {
                }
        }

#acPreProcForObjRename(*sourceObject,*destObject)|("*sourceObject" like "/ARCS/home/*/*") && ("*sourceObject" != "/ARCS/home/$userNameClient/Archive_S3")|nop|nop
acPreProcForObjRename(*sourceObject,*destObject) {
                on("*sourceObject" like "/ARCS/home/*/*") {
                }
        }

#acPreProcForObjRename(*sourceObject,*destObject)|"*sourceObject" like "/ARCS/projects/*/*"|nop|nop
acPreProcForObjRename(*sourceObject,*destObject) {
                on("*sourceObject" like "/ARCS/projects/*/*") {
                }
        }

#acPreProcForObjRename(*sourceObject,*destObject)|"*sourceObject" like "/ARCS/trash/*"|nop|nop
acPreProcForObjRename(*sourceObject,*destObject) {
                on("*sourceObject" like "/ARCS/trash/*") {
                }
        }


